// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using Elastic.Transport.Extensions;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Elastic.Clients.Elasticsearch.Serverless.MachineLearning;

public sealed partial class ClearTrainedModelDeploymentCacheRequestParameters : RequestParameters
{
}

/// <summary>
/// <para>
/// Clear trained model deployment cache.
/// Cache will be cleared on all nodes where the trained model is assigned.
/// A trained model deployment may have an inference cache enabled.
/// As requests are handled by each allocated node, their responses may be cached on that individual node.
/// Calling this API clears the caches without restarting the deployment.
/// </para>
/// </summary>
public sealed partial class ClearTrainedModelDeploymentCacheRequest : PlainRequest<ClearTrainedModelDeploymentCacheRequestParameters>
{
	public ClearTrainedModelDeploymentCacheRequest(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.clear_trained_model_deployment_cache";
}

/// <summary>
/// <para>
/// Clear trained model deployment cache.
/// Cache will be cleared on all nodes where the trained model is assigned.
/// A trained model deployment may have an inference cache enabled.
/// As requests are handled by each allocated node, their responses may be cached on that individual node.
/// Calling this API clears the caches without restarting the deployment.
/// </para>
/// </summary>
public sealed partial class ClearTrainedModelDeploymentCacheRequestDescriptor : RequestDescriptor<ClearTrainedModelDeploymentCacheRequestDescriptor, ClearTrainedModelDeploymentCacheRequestParameters>
{
	internal ClearTrainedModelDeploymentCacheRequestDescriptor(Action<ClearTrainedModelDeploymentCacheRequestDescriptor> configure) => configure.Invoke(this);

	public ClearTrainedModelDeploymentCacheRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Id modelId) : base(r => r.Required("model_id", modelId))
	{
	}

	internal override ApiUrls ApiUrls => ApiUrlLookup.MachineLearningClearTrainedModelDeploymentCache;

	protected override HttpMethod StaticHttpMethod => HttpMethod.POST;

	internal override bool SupportsBody => false;

	internal override string OperationName => "ml.clear_trained_model_deployment_cache";

	public ClearTrainedModelDeploymentCacheRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Serverless.Id modelId)
	{
		RouteValues.Required("model_id", modelId);
		return Self;
	}

	protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
	{
	}
}